/*
Copyright 2014, KISSY v1.47
MIT Licensed
build time: May 22 12:15
*/
KISSY.add("anim/timer/easing",[],function(){function j(a){return a}function e(a,b,n,f){var d=3*a-3*n+1,c=3*n-6*a,h=3*a,l=3*b-3*f+1,i=3*f-6*b,j=3*b;return function(a){a:{for(var b=a,f,n,k=0;8>k;k++){n=((d*b+c)*b+h)*b-a;if(m(n)<o){a=b;break a}f=(3*d*b+2*c)*b+h;if(m(f)<o)break;b-=n/f}f=1;k=0;for(b=a;f>k;){n=((d*b+c)*b+h)*b-a;if(m(n)<o)break;0<n?f=b:k=b;b=(f+k)/2}a=b}return((l*a+i)*a+j)*a}}var g=Math.PI,h=Math.pow,b=Math.sin,c=parseFloat,l=/^cubic-bezier\(([^,]+),([^,]+),([^,]+),([^,]+)\)$/i,i={swing:function(a){return-Math.cos(a*
g)/2+0.5},easeNone:j,linear:j,easeIn:function(a){return a*a},ease:e(0.25,0.1,0.25,1),"ease-in":e(0.42,0,1,1),"ease-out":e(0,0,0.58,1),"ease-in-out":e(0.42,0,0.58,1),"ease-out-in":e(0,0.42,1,0.58),toFn:function(a){var b;return(b=a.match(l))?e(c(b[1]),c(b[2]),c(b[3]),c(b[4])):i[a]||j},easeOut:function(a){return(2-a)*a},easeBoth:function(a){return 1>(a*=2)?0.5*a*a:0.5*(1- --a*(a-2))},easeInStrong:function(a){return a*a*a*a},easeOutStrong:function(a){return 1- --a*a*a*a},easeBothStrong:function(a){return 1>
(a*=2)?0.5*a*a*a*a:0.5*(2-(a-=2)*a*a*a)},elasticIn:function(a){return 0===a||1===a?a:-(h(2,10*(a-=1))*b(2*(a-0.075)*g/0.3))},elasticOut:function(a){return 0===a||1===a?a:h(2,-10*a)*b(2*(a-0.075)*g/0.3)+1},elasticBoth:function(a){return 0===a||2===(a*=2)?a:1>a?-0.5*h(2,10*(a-=1))*b(2*(a-0.1125)*g/0.45):0.5*h(2,-10*(a-=1))*b(2*(a-0.1125)*g/0.45)+1},backIn:function(a){1===a&&(a-=0.001);return a*a*(2.70158*a-1.70158)},backOut:function(a){return(a-=1)*a*(2.70158*a+1.70158)+1},backBoth:function(a){var b,
n=(b=2.5949095)+1;return 1>(a*=2)?0.5*a*a*(n*a-b):0.5*((a-=2)*a*(n*a+b)+2)},bounceIn:function(a){return 1-i.bounceOut(1-a)},bounceOut:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375},bounceBoth:function(a){return 0.5>a?0.5*i.bounceIn(2*a):0.5*i.bounceOut(2*a-1)+0.5}},o=1.0E-6,m=Math.abs;return i});
KISSY.add("anim/timer/manager",[],function(j){var e=j.stamp,g,h;g=function(b){return setTimeout(b,15)};h=function(b){clearTimeout(b)};return{runnings:{},timer:null,start:function(b){var c=e(b);this.runnings[c]||(this.runnings[c]=b,this.startTimer())},stop:function(b){this.notRun(b)},notRun:function(b){delete this.runnings[e(b)];j.isEmptyObject(this.runnings)&&this.stopTimer()},pause:function(b){this.notRun(b)},resume:function(b){this.start(b)},startTimer:function(){var b=this;b.timer||(b.timer=g(function l(){b.runFrames()?
b.stopTimer():b.timer=g(l)}))},stopTimer:function(){var b=this.timer;b&&(h(b),this.timer=0)},runFrames:function(){var b,c,h=this.runnings;for(b in h)h[b].frame();for(b in h){c=0;break}return void 0===c}}});
KISSY.add("anim/timer/fx",["dom"],function(j,e){function g(b){j.mix(this,b);this.pos=0;this.unit=this.unit||""}var h=e("dom");g.prototype={isCustomFx:0,constructor:g,load:function(b){j.mix(this,b);this.pos=0;this.unit=this.unit||""},frame:function(b){if(1!==this.pos){var c=this.anim,g=this.prop,i=c.node,e=this.from,m=this.propData,a=this.to;if(void 0===b)var k=j.now(),b=m.duration,k=k-c.startTime-m.delay,b=0>=k?0:k>=b?1:m.easing(k/b);this.pos=b;e===a||0===b||(this.val=e=this.interpolate(e,a,this.pos),
m.frame?m.frame.call(this,c,this):this.isCustomFx||(void 0===e?(this.pos=1,e=a):e+=this.unit,this.val=e,"attr"===this.type?h.attr(i,g,e,1):h.css(i,g,e)))}},interpolate:function(b,c,h){if("number"===typeof b&&"number"===typeof c)return Math.round(1E5*(b+(c-b)*h))/1E5},cur:function(){var b=this.prop,c,e,g=this.anim.node;if(this.isCustomFx)return g[b]||0;if(!(c=this.type))c=this.type=(!g.style||null==g.style[b])&&null!=h.attr(g,b,void 0,1)?"attr":"css";b="attr"===c?h.attr(g,b,void 0,1):h.css(g,b);return isNaN(e=
parseFloat(b))?!b||"auto"===b?0:b:e}};g.Factories={};g.FxTypes={};g.getFx=function(b){var c=g,h,e;if(h=b.fxType)c=g.FxTypes[h];else if(!b.isCustomFx&&(e=g.Factories[b.prop]))c=e;return new c(b)};return g});
KISSY.add("anim/timer/short-hand",[],function(){return{background:[],border:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],borderBottom:["borderBottomWidth"],borderLeft:["borderLeftWidth"],borderTop:["borderTopWidth"],borderRight:["borderRightWidth"],font:["fontSize","fontWeight"],margin:["marginBottom","marginLeft","marginRight","marginTop"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"]}});
KISSY.add("anim/timer/color",["./fx","./short-hand"],function(j,e){function g(b){var b=b+"",f;if(f=b.match(m))return[parseInt(f[1]),parseInt(f[2]),parseInt(f[3])];if(f=b.match(a))return[parseInt(f[1]),parseInt(f[2]),parseInt(f[3]),parseInt(f[4])];if(f=b.match(k)){for(b=1;b<f.length;b++)2>f[b].length&&(f[b]+=f[b]);return[parseInt(f[1],l),parseInt(f[2],l),parseInt(f[3],l)]}return o[b=b.toLowerCase()]?o[b]:[255,255,255]}function h(){h.superclass.constructor.apply(this,arguments)}var b=e("./fx"),c=e("./short-hand"),
l=16,i=Math.floor,o={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255]},m=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,a=/^rgba\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+),\s*([0-9]+)\)$/i,k=/^#?([0-9A-F]{1,2})([0-9A-F]{1,2})([0-9A-F]{1,2})$/i;c.background.push("backgroundColor");
c.borderColor=["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"];c.border.push("borderBottomColor","borderLeftColor","borderRightColor","borderTopColor");c.borderBottom.push("borderBottomColor");c.borderLeft.push("borderLeftColor");c.borderRight.push("borderRightColor");c.borderTop.push("borderTopColor");j.extend(h,b,{load:function(){h.superclass.load.apply(this,arguments);this.from&&(this.from=g(this.from));this.to&&(this.to=g(this.to))},interpolate:function(a,b,d){var k=
h.superclass.interpolate;if(3===a.length&&3===b.length)return"rgb("+[i(k(a[0],b[0],d)),i(k(a[1],b[1],d)),i(k(a[2],b[2],d))].join(", ")+")";if(4===a.length||4===b.length)return"rgba("+[i(k(a[0],b[0],d)),i(k(a[1],b[1],d)),i(k(a[2],b[2],d)),i(k(a[3]||1,b[3]||1,d))].join(", ")+")"}});j.each("backgroundColor,borderBottomColor,borderLeftColor,borderRightColor,borderTopColor,color,outlineColor".split(","),function(a){b.Factories[a]=h});return b.FxTypes.color=h});
KISSY.add("anim/timer/transform",["dom","./fx"],function(j,e){function g(a){a=a.split(/,/);return a=j.map(a,function(a){return b(a)})}function h(){return{translateX:0,translateY:0,rotate:0,skewX:0,skewY:0,scaleX:1,scaleY:1}}function b(a){return Math.round(1E5*parseFloat(a))/1E5}function c(a){for(var a=a.split(")"),k=j.trim,n=-1,f=a.length-1,d,e,c=h();++n<f;)switch(d=a[n].split("("),e=k(d[0]),d=d[1],e){case "translateX":case "translateY":case "scaleX":case "scaleY":c[e]=b(d);break;case "rotate":case "skewX":case "skewY":var i=
b(d);j.endsWith(d,"deg")||(i=180*i/Math.PI);c[e]=i;break;case "translate":case "translate3d":d=d.split(",");c.translateX=b(d[0]);c.translateY=b(d[1]||0);break;case "scale":d=d.split(",");c.scaleX=b(d[0]);c.scaleY=b(d[1]||d[0]);break;case "matrix":return a=d,a=g(a),f=n=k=void 0,e=a[0],c=a[1],d=a[2],i=a[3],e*i-c*d?(k=Math.sqrt(e*e+c*c),f=(e*d+c*i)/(e*i-d*c),n=(e*i-c*d)/k,e*i<c*d&&(f=-f,k=-k)):k=n=f=0,{translateX:b(a[4]),translateY:b(a[5]),rotate:b(180*Math.atan2(c,e)/Math.PI),skewX:b(180*Math.atan(f)/
Math.PI),skewY:0,scaleX:b(k),scaleY:b(n)}}return c}function l(){l.superclass.constructor.apply(this,arguments)}var i=e("dom"),o=e("./fx"),m=j.Features.isTransform3dSupported()?"translate3d({translateX}px,{translateY}px,0)":"translate({translateX}px,{translateY}px)";j.extend(l,o,{load:function(){l.superclass.load.apply(this,arguments);this.from=(this.from=i.style(this.anim.node,"transform")||this.from)&&"none"!==this.from?c(this.from):h();this.to=this.to?c(this.to):h()},interpolate:function(a,b,c){var f=
l.superclass.interpolate,d={};d.translateX=f(a.translateX,b.translateX,c);d.translateY=f(a.translateY,b.translateY,c);d.rotate=f(a.rotate,b.rotate,c);d.skewX=f(a.skewX,b.skewX,c);d.skewY=f(a.skewY,b.skewY,c);d.scaleX=f(a.scaleX,b.scaleX,c);d.scaleY=f(a.scaleY,b.scaleY,c);return j.substitute(m+" rotate({rotate}deg) skewX({skewX}deg) skewY({skewY}deg) scale({scaleX},{scaleY})",d)}});return o.Factories.transform=l});
KISSY.add("anim/timer","dom,./base,./timer/easing,./timer/manager,./timer/fx,./timer/short-hand,./timer/color,./timer/transform".split(","),function(j,e){function g(){var a;g.superclass.constructor.apply(this,arguments);j.each(a=this.to,function(b,c){var d=m(c);if(c!==d){a[d]=a[c];delete a[c]}})}var h=e("dom"),b=e("./base"),c=e("./timer/easing"),l=e("./timer/manager"),i=e("./timer/fx"),o=e("./timer/short-hand");e("./timer/color");e("./timer/transform");var m=h._camelCase,a=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i;
j.extend(g,b,{prepareFx:function(){var b=this.node,e=this._propsData;j.each(e,function(a){a.duration=a.duration*1E3;a.delay=a.delay*1E3;if(typeof a.easing==="string")a.easing=c.toFn(a.easing)});j.each(o,function(a,c){var d,f=e[c],g;if(f){g=f.value;d={};j.each(a,function(a){d[a]=h.css(b,a)});h.css(b,c,g);j.each(d,function(a,c){c in e||(e[c]=j.merge(f,{value:h.css(b,c)}));h.css(b,c,a)});delete e[c]}});var f,d,g,l,m,p,r,u=0,q;j.isPlainObject(b)&&(u=1);for(f in e){d=e[f];g=d.value;p={isCustomFx:u,prop:f,
anim:this,fxType:d.fxType,type:d.type,propData:d};r=i.getFx(p);l=g;m=r.cur();g=g+"";q="";if(g=g.match(a)){l=parseFloat(g[2]);if((q=g[3])&&q!=="px"&&m){var s=0,t=l;do{++t;h.css(b,f,t+q);s=r.cur()}while(s===0);m=t/s*m;h.css(b,f,m+q)}g[1]&&(l=(g[1]==="-="?-1:1)*l+m)}p.from=m;p.to=l;p.unit=q;r.load(p);d.fx=r}},frame:function(){var a,b=1,c,d=this._propsData;for(a in d){c=d[a];c=c.fx;c.frame();if(this.isRejected()||this.isResolved())return;b=b&c.pos===1}d=j.now();a=this.config.duration*1E3;d=Math.max(0,
this.startTime+a-d);this.defer.notify([this,1-(d/a||0),d]);b&&this.stop(b)},doStop:function(a){var b,c=this._propsData;l.stop(this);if(a)for(b in c){a=c[b];(a=a.fx)&&a.frame(1)}},doStart:function(){l.start(this)}});g.Easing=c;g.Fx=i;return g});
